<template>
  <view class="content">
<!--    <view class="tranInfo">
      本公文于 <span>{{prevDate}}</span> 由  <span>{{prevUser}}</span> 处转来
    </view>-->
    <view class="jjzy" v-if="detailObj1.detailObj.isUrgent == '1'">
      <span class="jjzy-border">紧急重要</span>
    </view>
    <view class="title">
      {{detailObj1.detailObj.headTitle}}
    </view>
    <view class="form-border" style="box-sizing: border-box;">
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>文件标题</label>
        </view>
        <view class="flex-six flex-center form-border-right">
          <span>{{detailObj1.detailObj.title}}</span>
        </view>
        <view class="flex-one flex-block form-border-right form-margin">
          <label>办理时限</label>
        </view>
        <view class="flex-one flex-center form-border-right">
          <span>{{detailObj1.detailObj.limitDate}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>来文单位</label>
        </view>
        <view class="flex-three flex-center form-border-right">
          <span>{{detailObj1.detailObj.fwDeptName}}</span>
        </view>
        <view class="flex-one flex-block form-border-right">
          <label>来文编号</label>
        </view>
        <view class="flex-two flex-center form-border-right">
          <span>{{detailObj1.detailObj.fwcode}}</span>
        </view>
        <view class="flex-one flex-block form-border-right">
          <label>密级</label>
        </view>
        <view class="flex-one flex-center form-border-right">
          <span>{{this.dict.getDictNameByDictCode('mj', detailObj1.detailObj.secrecyLevel)}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>收文编号</label>
        </view>
        <view class="flex-three flex-center form-border-right">
          <span>{{detailObj1.detailObj.swcode}}</span>
        </view>
        <view class="flex-one flex-block form-border-right">
          <label>收文时间</label>
        </view>
        <view class="flex-two flex-center form-border-right">
          <span style="font-size: 26rpx;">{{detailObj1.detailObj.swTime}}</span>
        </view>
        <view class="flex-one flex-block form-border-right">
          <label>紧急程度</label>
        </view>
        <view class="flex-one flex-center form-border-right">
          <span>{{this.dict.getDictNameByDictCode('swjjcd',detailObj1.detailObj.emergencyLevel)}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>呈送领导</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <span>{{detailObj1.detailObj.praiseUserNames}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>主办部门</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <span>{{detailObj1.detailObj.directDeptNames}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>协办部门</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <span>{{detailObj1.detailObj.copyToDeptNames}}</span>
        </view>
      </view>
      <view class="form-row" style="min-height: 160rpx;">
        <view class="flex-one flex-block form-border-right">
          <label>局领导批示</label>
        </view>
        <view class="flex-eight form-border-right">
          <template v-if="detailObj1.opinion != null && detailObj1.opinion['jldps'] != undefined">
            <view v-for="item in detailObj1.opinion.jldps">
              <view style="padding: 10rpx;">{{item.opinion}}</view>
              <view class="opinion flex-block-end" >
                <!-- base64签名图片 -->
                <img v-if="item.signature!='' && item.signature != undefined" :src="`data:image/png;base64,`+item.signature" alt="图片未上传" />
                <span v-else>{{item.userName}}</span>
                <span> {{item.approvalTime}}</span>
              </view>
            </view>
          </template>
        </view>
      </view>
      <view class="form-row" style="min-height: 160rpx;">
        <view class="flex-one flex-block form-border-right">
          <label>办理部门意见</label>
        </view>
        <view class="flex-eight form-border-right">
          <template v-if="detailObj1.opinion != null && detailObj1.opinion['blbmyj'] != undefined">
            <view v-for="item in detailObj1.opinion.blbmyj">
              <view style="padding: 10rpx;">{{item.opinion}}</view>
              <view class="opinion flex-block-end" >
                <!-- base64签名图片 -->
                <img v-if="item.signature!='' && item.signature != undefined" :src="`data:image/png;base64,`+item.signature" alt="图片未上传" />
                <span v-else>{{item.userName}}</span>
                <span> {{item.approvalTime}}</span>
              </view>
            </view>
          </template>
        </view>
      </view>
      <view class="form-row" style="min-height: 160rpx;">
        <view class="flex-one flex-block form-border-right">
          <label>注办部门意见</label>
        </view>
        <view class="flex-eight form-border-right">
          <template v-if="detailObj1.opinion != null && detailObj1.opinion['gljswnbyj'] != undefined">
            <view v-for="item in detailObj1.opinion.gljswnbyj">
              <view style="padding: 10rpx;">{{item.opinion}}</view>
              <view class="opinion flex-block-end" >
                <!-- base64签名图片 -->
                <img v-if="item.signature!='' && item.signature != undefined" :src="`data:image/png;base64,`+item.signature" alt="图片未上传" />
                <span v-else>{{item.userName}}</span>
                <span> {{item.approvalTime}}</span>
              </view>
            </view>
          </template>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>备注</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <span>{{detailObj1.detailObj.remark}}</span>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>正文</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <template v-if="detailObj1.detailBody !=null">
            <view v-for="item in detailObj1.detailBody">
              <span>{{item.attachName}}</span>
            </view>
          </template>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>附件</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <template v-if="detailObj1.detailAttachment != undefined && detailObj1.detailAttachment.length > 0 ">
            <view v-for="item in detailObj1.detailAttachment">
              <span>{{item.attachName}}</span>
            </view>
          </template>
        </view>
      </view>
      <view class="form-row">
        <view class="flex-one flex-block form-border-right">
          <label>批示分送</label>
        </view>
        <view class="flex-eight flex-center form-border-right">
          <span>{{detailObj1.detailObj.psfsDeptName}}</span>
        </view>
      </view>

    </view>

  </view>
</template>

<script>
export default {
  name: "compo-read",
  props: {
    detailObj1: {
      detailObj:Object,       // 公文基本信息
      detailBody:Object,      // 正文
      detailAttachment:Object,// 附件
      relation:Object,        // 附加公文[{"id":"1c0962f8839d46f792f84e5c89c96f14","title":"ppap","relateDocId":"4ec205b8334446f9b932d0fcb3896bc8","proInstId":"4ec205b8334446f9b932d0fcb3896bc8"},{"id":"2f4aa437ecba4c748bff911f03667147","title":"py","relateDocId":"86d30c881c494b468534685bb0746174","proInstId":"86d30c881c494b468534685bb0746174"}]
      opinion:Object,         // 意见
    },
    proInstId: {
      type: String,
      default: ''
    }
  },

  data() {
    return {
      prevDate: '',
      prevUser: '',
    };
  },

  watch: {
    proInstId: {
      handler(nval, oval) {
        if (this.util.isNotEmpty(nval)) {
          // 获取传送信息
          // this.getPrevInfo(nval)
        }
      },
      immediate: true,
      deep: true
    }
  },

  created() {

  },

  mounted() {

  },

  methods: {
    // 获取传送信息
    getPrevInfo(proInstId) {
      let _this = this
      _this.$http({
        url: _this.$http.adornUrl(`/caac/oa/component/workflow/workflowController/getPreviouProTrack`),
        method: 'get',
        params: {
          'systemKey': _this.cache.get('userInfo').systemKey,
          'systemFlag': _this.cache.get('userInfo').systemFlag,
          'proInstId': proInstId
        }
      }).then(({data}) => {
        if (data.code == 200) {
          _this.prevDate = data.data.createTime
          _this.prevUser = data.data.sendUserName
        }
      })
    },


  }



}
</script>

<style scoped>
 .content {
   padding: 10rpx;
   word-break: break-all;
   font-size: 26rpx;
 }
 .tranInfo {
   display: flex;
   justify-content: flex-end;
   margin-right: 10rpx;
 }
 .tranInfo span {
   font-weight: 600;
 }
 .jjzy {
   margin-top: 30rpx;
   margin-left: 10rpx;
   margin-right: 10rpx;
 }
 .jjzy-border {
   border: 1px solid #ed1c24;
   color: #ed1c24 !important;
   padding: 10rpx;
 }
 .title {
   display: flex;
   justify-content: center;
   color: #ed1c24;
   font-weight: 600;
   font-size: 36rpx;
   margin-top: 30rpx;
   margin-bottom: 20rpx;
   letter-spacing: 10rpx;
 }
 .form-border {
   border: 1px solid #E00418;
   border-bottom: none;
   border-right: none;
 }
 .form-border-right {
   border-bottom: 1px solid #E00418;
   border-right: 1px solid #E00418;
 }
 .form-margin {
   margin-left: -0.5px;
   margin-right: -0.5px;
 }
 .form-row {
   display: flex;
   justify-content: center;
   flex: 1;
 }
 .form-row label {
   color: #ed1c24;
   padding: 10rpx;
   text-align: center;
 }
 .form-row span {
   color: #000000;
   padding: 10rpx;
   text-align: left;
 }
 .flex-block {
   display: flex;
   align-items: center;
   justify-content: center;
   text-align: center;
   padding: 10rpx 0;
 }
 .flex-center {
   display: flex;
   align-items: center;
 }
 .flex-one {
   flex: 1;
   position: relative;
 }

 .flex-two {
   flex: 2;
   position: relative;
 }

 .flex-three {
   flex: 3;
   position: relative;
 }

 .flex-four {
   flex: 4;
   position: relative;
 }

 .flex-five {
   flex: 5;
   position: relative;
 }

 .flex-six {
   flex: 6;
   position: relative;
 }

 .flex-seven {
   flex: 7;
   position: relative;
 }

 .flex-eight {
   flex: 8;
   position: relative;
 }

 .flex-nine {
   flex: 9;
   position: relative;
 }

 .flex-ten {
   flex: 10;
   position: relative;
 }
 .flex-eleven {
   flex: 11;
   position: relative;
 }
 .flex-twelve {
   flex: 12;
   position: relative;
 }
 .flex-block-end {
   display: flex;
   align-items: center;
   justify-content: flex-end;
   text-align: center;
   /* font-family: SimSun; */
 }
 .opinion span {
   /*font-weight: 400;
   color: #000000;*/
 }
</style>
